package com.armani.mapper;

import com.armani.entity.Address;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ProjectName: armani
 * @Package: com.armani.mapper
 * @ClassName: AddressMapper
 * @Description: TODO
 * @Author: Roc
 * @Date: 2021/11/28 21:09
 * @Version: 1.0
 **/
public interface AddressMapper {
    /**
     *
     * @param shopUser
     * @param userId
     * @param phone
     * @param province
     * @param city
     * @param district
     * @param detail
     * @param startRow
     * @param limit
     * @return
     */
    List<Address> ListSearch(@Param(value = "shopUser") String shopUser,
                             @Param(value = "userId")Integer userId,
                             @Param(value = "phone") String phone,
                             @Param(value = "province")String province,
                             @Param(value = "city")String city,
                             @Param(value = "district")String district,
                             @Param(value = "detail") String detail,
                             @Param(value = "startRow")Integer startRow,
                             @Param(value = "limit") Integer limit);

    /**
     * 获取总条数
     * @param shopUser
     * @param userId
     * @param phone
     * @param province
     * @param city
     * @param district
     * @param detail
     * @return
     */
    Integer getCount(@Param(value = "shopUser") String shopUser,
                     @Param(value = "userId")Integer userId,
                     @Param(value = "phone") String phone,
                     @Param(value = "province")String province,
                     @Param(value = "city")String city,
                     @Param(value = "district")String district,
                     @Param(value = "detail") String detail);

    /**
     * 添加
     * @param shopUser
     * @param userId
     * @param phone
     * @param province
     * @param city
     * @param district
     * @param detail
     * @return
     */
    Integer insert(@Param(value = "shopUser") String shopUser,
                   @Param(value = "userId")Integer userId,
                   @Param(value = "phone") String phone,
                   @Param(value = "province")String province,
                   @Param(value = "city")String city,
                   @Param(value = "district")String district,
                   @Param(value = "detail") String detail);

    /**
     * 修改
     * @param shopUser
     * @param userId
     * @param phone
     * @param province
     * @param city
     * @param district
     * @param detail
     * @param id
     * @return
     */
    Integer update(@Param(value = "shopUser") String shopUser,
                   @Param(value = "userId")Integer userId,
                   @Param(value = "phone") String phone,
                   @Param(value = "province")String province,
                   @Param(value = "city")String city,
                   @Param(value = "district")String district,
                   @Param(value = "detail") String detail,
                   @Param(value = "id") Integer id);

    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete( @Param(value = "id")Integer id);

    /**
     * 查询用户地址
     * @param userId 用户id
     * @return 用户地址列表
     */
    List<Address> searchByUserId(Integer userId);
}
